package com.yc.blog.springboot.event.demo3;

/**
 * 测试观察者模式
 */
public class Test {

	public static void main(String[] args) {
		//创建目标
		Subject subjec = new SubjectImpl();
		//注册观察者
		Observer observer1 = new ObserverImpl1();
		Observer observer2 = new ObserverImpl2();
		subjec.addObserver(observer1);
		subjec.addObserver(observer2);
		//（事件触发）通知观察者
		subjec.inform();
	}

}
